package Calendar;

import java.util.Calendar;
import java.util.Date;

public class demo1 {
    public static void main(String[] args) {
        Calendar n = Calendar.getInstance();
        Date d = new Date(0L);
        n.setTime(d);
        System.out.println(n);
        //设置月份
        n.set(Calendar.MONTH,10);
        int year = n.get(Calendar.YEAR);
        n.add(Calendar.MONTH,1);
        int month = n.get(Calendar.MONTH) + 1;
        int day = n.get(Calendar.DAY_OF_MONTH);
        int week = n.get(Calendar.DAY_OF_WEEK);

        System.out.println(year + ", " + month + ", " + day + ", " + getWeek(week));

    }
    public static String getWeek(int index){
        String []arr = {"","周日","周一","周二","周三","周四","周五","周六"};
        return arr[index];
    }
}
